let header_v = new Vue({
    el:"header",
    data:{
        arr:[],
        wd:""
    },
    created:function () {
        axios.get("/category/select").then(function (response) {
            header_v.arr = response.data;
        })
    },
    methods:{
        admin:function () {
            //发请求询问是否登录过
            axios.get("/currentUser").then(function (response) {
                if (response.data==""){
                    location.href="/login.html";
                }else{
                    location.href="/admin.html";
                }
            })
        },
        search:function (){
            location.href = "/index.html?wd="+header_v.wd;
        }
    }
})